package com.example.dome1.web;

import com.example.dome1.config.SpringConfiguration;
import com.example.dome1.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserController {
    public static void main(String[] args){
        //加载xml文件
        //ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");
        //加载配置文件
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfiguration.class);
        UserService userService = applicationContext.getBean(UserService.class);
        userService.save();
    }
}
